#!/usr/bin/env python

""" 
Register Level Program 
    - Represent the whole RL program
"""

__author__ = 'liwei79@gmail.com'

from RTLRoutine import *

class RTLProgram:
    def __init__(self):
        self.routs = []

    def addRout(self, rout):
        self.routs.append(rout)

    def __repr__(self):
        str = '[START PROGRAM]\n'
        for r in self.routs:
            str = str + repr(r) + "\n"
        str = str + "[END PROGRAM]" + "\n"
        return str

if __name__ == "__main__":
    head = CodeRout("foo", OpndLst([OpndReg("a"), OpndReg("b"), OpndReg("c")]))
    r = RTLRoutine(head, 1)
    r2 = RTLRoutine(head, 2)
    p = RTLProgram()
    p.addRout(r)
    p.addRout(r2)
    print p
